<?php
namespace app\index\controller;

use app\common\model\Chat;
use app\common\model\Info;
use app\common\model\Qqjob;
use app\common\model\Qqs;
use app\common\model\Gg;
use app\common\model\Users;
use app\common\model\Weblist;

class PcAjax extends Common
{
	private $loginapi = '';
    private $ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36';
    private $trace_x;
    private $trace_y;
    private $trace_time;
    private $tokenid;

    public function setLoginApi($url)
    {
        $this->loginapi = $url;
    }
	
	public function qq($act)
    {
        switch ($act) {
			case 'del':
					$data = input('post.qid');
                    $del_res = Qqs::delbyqid($data);
                    Qqjob::where('qid', '=', $data)->delete();
                    if ($del_res) {
                        $result = "<script>x.mclose();x.msg('删除成功');setTimeout(function(){x.pjax('/pc/index/act/user/s/qqlist.html','');}, 500);</script>";
                    } else {
                        $result = '<script>x.msg(\'删除失败\');</script>';
                    }
                break;
			case 'save':
                    $data = input('post.');
					$data['sid']='1';
					$data['type']='1';
                    $add = Qqs::madd($data, $this->userInfo);
					$qdt = Qqs::where('qq', '=', $data['qq'])->find();
					$result = "<script>x.mclose();sm.cleartime();x.msg('".$add['message']."');setTimeout(function(){x.pjax('/pc/index/act/user/s/qqset.html?qid=".$qdt['qid']."','');}, 500);</script>";
                break;
			case 'saoma':
			        $data = input('post.');
					if(!input('area'))$result = '<script>x.msg(\'请选择服务器\');</script>';
					if(config('sys_is_qqlogin_api_check_'.input('area'))==NULL){
						$result = '<script>x.mclose();sm.cleartime();x.msg(\'登陆服务器不存在\');</script>';
					}elseif(config('sys_is_qqlogin_api_check_'.input('area'))==0){
						$result = '<script>x.mclose();sm.cleartime();x.msg(\'登陆服务器未开启\');</script>';
					}else{
						$api = config('sys_is_qqlogin_api_url_'.input('area'));
						if(input('get.is')){
							$data=[
							];
							$send=json_decode(send_get($api.'?do=getqrpic',$data),true);
							$result = '<script>sm.img("'.$send['qrsig'].'","","'.$send['data'].'");</script>';
						}else{
							$qrsig = input('post.qrsig');
							$check=json_decode(send_get($api.'?do=qrlogin&qrsig='.$qrsig),true);
							if($check['saveOK']==0){
								$data = [
									'qq' => $check['uin'],
									'area'	=> input('area'),
									'pwd' => '',
									'type' => '0',
									'skey' => '@' . $check['skey'],
									'pskey' => $check['pskey'],
									'superkey' => $check['superkey'],
								];
								$json = Qqs::madd($data, $this->userInfo);
								$qdt = Qqs::where('qq', '=', $check['uin'])->find();
								$result = "<script>x.mclose();sm.cleartime();x.msg('".$json['message']."');setTimeout(function(){x.pjax('/pc/index/act/user/s/qqset.html?qid=".$qdt['qid']."','');}, 500);</script>";
							}elseif($check['saveOK']==1){
								$result = '<script>$("#qrimg").html("<p class=\'pt12 hui\'>二维码加载中</p>");$("#loginmsg").html("二维码失效，正在重新获取");setTimeout(function(){_sm_qrpic();}, 3000);</script>';
							}elseif($check['saveOK']==2){
								$result = '<script></script>';
							}elseif($check['saveOK']==3){
								$result = '<script>_sm_success();</script>';
							}elseif($check['saveOK']==6){
								$result = '<script>x.mclose();sm.cleartime();x.mclose(moid["qqlist_add"]);x.msg(\'登陆成功,获取QQ信息失败,请稍后重试\');</script>';
							}else{
								$result = '<script>'.$check['msg'].'</script>';
							}
						}
					}
                break;
				
        }
		echo $result;
    }
	
	public function gnset($act)
    {
        switch ($act) {
			case 'delete':
                    $qid = input('post.qid');
                    $type = input('post.xm');
                    if (!Qqjob::where(['qid' => $qid, 'type' => $type,'zid' => WEB_ID])->find()) {
                        echo '<script>x.msg(\'删除成功\');$(\'#is'.$type.'\').remove();</script>';
                    } else {
                        Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $type)
                            ->delete();
                        echo '<script>x.msg(\'删除成功\');$(\'#is'.$type.'\').remove();</script>';
                    }
                    break;
			case 'add':
				$qid = input('post.qid');
				$uin = input('post.uin');
				$type = input('post.type');
				$id = input('post.gnid');
				$cylb = cylb_name($type);
				if (Qqjob::where(['qid' => $qid, 'type' => $type, 'zid' => WEB_ID])->find()) {
					echo '<script>x.msg(\'添加成功\');</script>';
				} else {
					Qqjob::insert([
						'zid' => WEB_ID,
						'uid' => $this->userInfo['uid'],
						'qid' => $qid,
						'qq' => $uin,
						'type' => $type,
						'gnid' => $id,
						'ph' => $cylb['id'],
						'lasttime' => '01-01 00:00:00'
					]);
					echo '<script>x.msg(\'添加成功\');$(".'.$type.'access").html("已添加");load_qqset_html('.$qid.',2,1);</script>';
				}
				break;
			case 'zan':
                    $data = input('post.');
                    $diff = timediff(strtotime($this->userInfo['vipstart']), strtotime($this->userInfo['viptime']));
                    if ($data['iszt'] == 2 && $this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞VIP会员才可以使用该功能!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } elseif ($data['iszt'] == 3 && $diff < 89) {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $update = [
                            'server' => $data['iszt'],
                            'start' => $data['is'],
                            'xy' => 1,
                            'mode' => $data['mode'],
                            'list' => $data['qqlist'],
                            'nexttime' => time(),
                            'date' => date('m-d H:i:s')
                        ];
                        Qqjob::
                        where('qid', '=', $data['qid'])
                            ->where('type', '=', $act)
                            ->update($update);
						if ($data['is'] == 1) {
							echo '<script>x.mclose();x.msg(\'保存成功\');$("#iszan input").prop("checked", true);$("#iszan .icon-dian").removeClass("hong").addClass("lv");</script>';
						}else{
							echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#iszan input").prop("checked", false);$("#iszan .icon-dian").removeClass("lv").addClass("hong");</script>';
						}
                    }
                    break;
				case 'reply':
                    $data = input('post.');
                    if ($data['rate'] < 1) {
						echo '<script>x.mclose();x.msg(\'评论的频率速度过快，建议最少1分钟\');</script>';
                    } else {
                        $update = [
                            'start' => $data['is'],
                            'rate' => $data['rate'],
                            'xy' => 1,
                            'data' => $data['con'],
                            'nexttime' => time(),
                            'date' => date('m-d H:i:s')
                        ];
                        Qqjob::
                        where('qid', '=', $data['qid'])
                            ->where('type', '=', $act)
                            ->update($update);
                        if ($data['is'] == 1) {
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#isreply input").prop("checked", true);$("#isreply .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#isreply input").prop("checked", false);$("#isreply .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'qunqd':
                    $data = input('post.');
                    $update = [
                        'start' => $data['is'],
                        'mode' => $data['mode'],
                        'list' => $data['list'],
                        'tuid' => $data['tuid'],
                        'url' => $data['url'],
                        'data' => $data['con'],
                        'nexttime' => time(),
                        'date' => date('m-d H:i:s')
                    ];
                    Qqjob::
                    where('qid', '=', $data['qid'])
                        ->where('type', '=', $act)
                        ->update($update);
							if ($data['is'] == 1) {
								echo '<script>x.mclose();x.msg(\'保存成功\');$("#isqunqd input").prop("checked", true);$("#isqunqd .icon-dian").removeClass("hong").addClass("lv");</script>';
							} else {
								echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#isqunqd input").prop("checked", false);$("#isqunqd .icon-dian").removeClass("lv").addClass("hong");</script>';
							}
                    break;
				case 'mqq':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', 'mqq')
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'mqq')
                                ->update($update);
                            echo '<script>x.msg(\'功能已开启\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'mqq')
                                ->update($update);
                            echo '<script>x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
                case 'sy':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                       echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', 'sy')
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'sy')
                                ->update($update);
                            echo '<script>x.msg(\'功能已开启\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'sy')
                                ->update($update);
                            echo '<script>x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'shuo':
                    $data = input('post.');
                    if ($data['rate'] < 10) {
                        echo '<script>x.msg(\'发送频率过快\');';
                    } else {
                        $update = [
                            'start' => $data['is'],
                            'rate' => $data['rate'],
                            'xy' => $data['xy'],
                            'data' => $data['con'],
                            'tuid' => $data['tuid'],
                            'url' => $data['url'],
                            'mode' => $data['mode'],
                            'del' => $data['del'],
                            'nexttime' => time(),
                            'date' => date('m-d H:i:s')
                        ];
                        Qqjob::
                        where('qid', '=', $data['qid'])
                            ->where('type', '=', $act)
                            ->update($update);
                        if ($data['is'] == 1) {
							echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
						} else {
							echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
						}
                    }
                    break;
				case 'zf':
                    $data = input('post.');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        if ($data['rate'] < 10) {
                            echo '<script>x.msg(\'转发频率过快\');';
                        } else {
                            $update = [
                                'start' => $data['is'],
                                'rate' => $data['rate'],
                                'xy' => 0,
                                'data' => $data['con'],
                                'list' => $data['qqlist'],
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $data['qid'])
                                ->where('type', '=', $act)
                                ->update($update);
                            if ($data['is'] == 1) {
								echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
							} else {
								echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
							}
                        }
                    }
                    break;
				case 'qipao':
                    $data = input('post.');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $update = [
                            'start' => $data['is'],
                            'mode' => $data['mode'],
                            'nexttime' => time(),
                            'date' => date('m-d H:i:s')
                        ];
                        Qqjob::
                        where('qid', '=', $data['qid'])
                            ->where('type', '=', $act)
                            ->update($update);
                        if ($data['is'] == 1) {
							echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
						} else {
							echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
						}
                    }
                    break;
				case 'ql':
                    $data = input('post.');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $update = [
                            'start' => $data['is'],
                            'mode' => $data['mode'],
                            'nexttime' => time(),
                            'date' => date('m-d H:i:s')
                        ];
                        Qqjob::
                        where('qid', '=', $data['qid'])
                            ->where('type', '=', $act)
                            ->update($update);
							if ($data['is'] == 1) {
								echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
							} else {
								echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
							}
                    }
                    break;
				case 'del':
				$qid = input('qid');
				if ($this->userInfo['vipstart'] == '') {
					echo '<script>
							x.mclose();
							layer.confirm(
								\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
								{
									btn:[\'去 开 通\', \'取 消\'],
									btnAlign:\'c\',
									yes:function(i){
										x.close(i);
										mode_shop_vip();
									},
									btn2:function(i){
										x.close(i);
										
									}
								}
							);
						</script>';
				} else {
					$row = Qqjob::where('qid', '=', $qid)
						->where('type', '=', 'del')
						->find();
					if ($row['start'] == 0) {
						$update = [
							'start' => 1,
							'nexttime' => time(),
							'date' => date('m-d H:i:s')
						];
						Qqjob::
						where('qid', '=', $qid)
							->where('type', '=', 'del')
							->update($update);
						echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
					} else {
						$update = [
							'start' => 0,
							'nexttime' => time(),
							'date' => date('m-d H:i:s')
						];
						Qqjob::
						where('qid', '=', $qid)
							->where('type', '=', 'del')
							->update($update);
						echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
					}
				}
                    break;
				case 'delly':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', 'delly')
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'delly')
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'delly')
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'ht':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', 'ht')
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'ht')
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', 'ht')
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'qd':
                    $data = input('post.');
                    $update = [
                        'start' => $data['is'],
                        'data' => $data['con'],
                        'nexttime' => time(),
                        'date' => date('m-d H:i:s')
                    ];
                    Qqjob::
                    where('qid', '=', $data['qid'])
                        ->where('type', '=', $act)
                        ->update($update);
					if ($data['is'] == 1) {
						echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
					} else {
						echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
					}
                    break;
				case 'hyqd':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'hzqd':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'hlwqd':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'dhyqd':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'wsqd':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'renqi':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'wyqd':
					if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
						$data = input('post.');
						$update = [
							'start' => $data['is'],
							'list' => $data['username'],
							'data' => $data['password'],
							'nexttime' => time(),
							'date' => date('m-d H:i:s')
						];
						Qqjob::
						where('qid', '=', $data['qid'])
							->where('type', '=', $act)
							->update($update);
						if ($data['is'] == 1) {
							echo '<script>x.mclose();x.msg(\'保存成功\');$("#iswyqd input").prop("checked", true);$("#iswyqd.icon-dian").removeClass("hong").addClass("lv");</script>';
						} else {
							echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#iswyqd input").prop("checked", false);$("#iswyqd .icon-dian").removeClass("lv").addClass("hong");</script>';
						}
					}
                    break;
				case 'yundong':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
				case 'hzmp':
                    $qid = input('qid');
                    if ($this->userInfo['vipstart'] == '') {
                        echo '<script>
								x.mclose();
								layer.confirm(
									\'<div><h4 class="mt0 mb5">开启失败</h4></div><div>您需要开通秒赞包季会员才可以使用急速服务器!</div>\',
									{
										btn:[\'去 开 通\', \'取 消\'],
										btnAlign:\'c\',
										yes:function(i){
											x.close(i);
											mode_shop_vip();
										},
										btn2:function(i){
											x.close(i);
											
										}
									}
								);
							</script>';
                    } else {
                        $row = Qqjob::where('qid', '=', $qid)
                            ->where('type', '=', $act)
                            ->find();
                        if ($row['start'] == 0) {
                            $update = [
                                'start' => 1,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'保存成功\');$("#is'.$act.' input").prop("checked", true);$("#is'.$act.' .icon-dian").removeClass("hong").addClass("lv");</script>';
                        } else {
                            $update = [
                                'start' => 0,
                                'nexttime' => time(),
                                'date' => date('m-d H:i:s')
                            ];
                            Qqjob::
                            where('qid', '=', $qid)
                                ->where('type', '=', $act)
                                ->update($update);
                            echo '<script>x.mclose();x.msg(\'功能已关闭\');$("#is'.$act.' input").prop("checked", false);$("#is'.$act.' .icon-dian").removeClass("lv").addClass("hong");</script>';
                        }
                    }
                    break;
        }
    }
	
	private function getuin($uin)
    {
        for ($i = 0; $i < strlen($uin); $i++) {
            if ($uin[$i] == 'o' || $uin[$i] == '0') continue;
            else break;
        }
        return substr($uin, $i);
    }

    private function getqrtoken($qrsig)
    {
        $len = strlen($qrsig);
        $hash = 0;
        for ($i = 0; $i < $len; $i++) {
            $hash += (($hash << 5) & 2147483647) + ord($qrsig[$i]) & 2147483647;
            $hash &= 2147483647;
        }
        return $hash & 2147483647;
    }

    private function captcha($imgAurl, $imgBurl)
    {
        $imgA = imagecreatefromjpeg($imgAurl);
        $imgB = imagecreatefromjpeg($imgBurl);
        $imgWidth = imagesx($imgA);
        $imgHeight = imagesy($imgA);

        $t = 0;
        $r = 0;
        for ($y = 20; $y < $imgHeight - 20; $y++) {
            for ($x = 20; $x < $imgWidth - 20; $x++) {
                $rgbA = imagecolorat($imgA, $x, $y);
                $rgbB = imagecolorat($imgB, $x, $y);
                if (abs($rgbA - $rgbB) > 1800000) {
                    $t++;
                    $r += $x;
                }
            }
        }
        return round($r / $t) - 55;
    }

    private function getcdata($ans, $M, $randstr)
    {
        for ($r = 0; $r < $M && $r < 1000; $r++) {
            $c = $randstr . $r;
            $d = md5($c);
            if ($ans == $d) {
                $a = $r;
                break;
            }
        }
        return $a;
    }

    private function generate_slideValue($width)
    {
        $sx = rand(700, 730);
        $sy = rand(295, 300);
        $this->trace_x = $sx;
        $this->trace_y = $sy;
        $ex = $sx + intval(($width - 55) / 2);
        $stime = rand(100, 300);
        $res = '[' . $sx . ',' . $sy . ',' . $stime . '],';
        while ($sx < $ex) {
            $x = rand(1, 5);
            $sx += $x;
            $y = 0;
            $time = rand(9, 16);
            $stime += $time;
            $res .= '[' . $x . ',' . $y . ',' . $time . '],';
        }
        $res = substr($res, 0, -1);
        return $res;
    }

    private function generate_mousemove($width)
    {
        $sx = rand(720, 810);
        $sy = rand(270, 290);
        $stime = rand(800, 1000);
        $res = '[' . $sx . ',' . $sy . ',' . $stime . '],';
        while ($sx > $this->trace_x || $sy < $this->trace_y) {
            if ($sx > $this->trace_x) $x = rand(-5, -1);
            else $x = 0;
            if ($sy < $this->trace_y) $y = rand(1, 2);
            else $y = 0;
            $sx += $x;
            $sy += $y;
            $time = rand(9, 16);
            $stime += $time;
            $res .= '[' . $x . ',' . $y . ',' . $time . '],';
        }
        $ex = $this->trace_x + intval(($width - 55) / 2);
        while ($sx < $ex) {
            $x = rand(1, 5);
            $sx += $x;
            $y = 0;
            $time = rand(9, 16);
            $stime += $time;
            $res .= '[' . $x . ',' . $y . ',' . $time . '],';
        }
        $res = substr($res, 0, -1);
        $this->trace_time = ceil($stime / 1000);
        $this->trace_x = $sx;
        $this->trace_y = $sy;
        return $res;
    }

    public function getcollect($width)
    {
        $begintime = time();
        $this->tokenid = $this->randNumber(10);
        $ip = '10.9.' . rand(10, 150) . '.' . rand(10, 150);
        $slideValue = $this->generate_slideValue($width);
        $mousemove = $this->generate_mousemove($width);
        $endtime = $begintime + $this->trace_time;
        $string = '{"mouseclick":[],"keyvalue":[],"user_Agent":"' . $this->ua . '","resolutionx":1920,"resolutiony":1080,"winSize":[1600,522],"url":"https://ssl.captcha.qq.com/cap_union_new_show","refer":"https://ui.ptlogin2.qq.com/cgi-bin/login","begintime":' . $begintime . ',"endtime":' . $endtime . ',"platform":1,"os":"other","keyboards":0,"flash":1,"pluginNum":22,"index":1,"ptcz":"","tokenid":' . $this->tokenid . ',"a":' . $this->tokenid . ',"btokenid":null,"tokents":' . $begintime . ',"ips":{"in":["' . $ip . '"]},"colorDepth":24,"cookieEnabled":true,"timezone":8,"wDelta":0,"mousemove":[' . $mousemove . '],"keyUpCnt":0,"keyUpValue":[],"mouseUpValue":[{"t":' . $this->trace_time . ',"x":' . $this->trace_x . ',"y":' . $this->trace_y . '}],"mouseUpCnt":1,"mouseDownValue":[],"mouseDownCnt":0,"orientation":[{"x":0,"y":0,"z":0}],"bSimutor":0,"focusBlur":{"in":[],"out":[],"t":[]},"fVersion":27,"charSet":"UTF-8","resizeCnt":0,"errors":[],"screenInfo":"1920-1080-1042-24-*-*-*","elapsed":1000,"ft":"6f_7P_n_H","clientType":"1","coordinate":[654,102,0.4294],"trycnt":1,"refreshcnt":0,"slideValue":[' . $slideValue . '],"dragobj":0}';
        return $this->aes_encrypt($string);
    }

    private function aes_encrypt($data)
    {
        $secret_key = '0123456789abcdef';
        $iv = '0123456789abcdef';
        if (function_exists("openssl_encrypt")) {
            return openssl_encrypt($data, 'aes-128-cbc', $secret_key, false, $iv);
        } else {
            return $this->get_curl('http://music.api.cccyun.cc/aes.php', array('data' => $data));
        }
    }

    private function randNumber($length)
    {
        $str = '123456789';
        $len = strlen($str) - 1;
        $randstr = '';
        for ($i = 0; $i < $length; $i++) {
            $num = mt_rand(0, $len);
            $randstr .= $str[$num];
        }
        return $randstr;
    }

    private function get_curl($url, $post = 0, $referer = 0, $cookie = 0, $header = 0, $ua = 0, $nobaody = 0)
    {
        if ($this->loginapi) return $this->get_curl_proxy($url, $post, $referer, $cookie, $header, $ua, $nobaody);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        $httpheader[] = "Accept: application/json";
        $httpheader[] = "Accept-Encoding: gzip,deflate,sdch";
        $httpheader[] = "Accept-Language: zh-CN,zh;q=0.8";
        $httpheader[] = "Connection: keep-alive";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
        if ($post) {
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
        }
        if ($header) {
            curl_setopt($ch, CURLOPT_HEADER, TRUE);
        }
        if ($cookie) {
            curl_setopt($ch, CURLOPT_COOKIE, $cookie);
        }
        if ($referer) {
            curl_setopt($ch, CURLOPT_REFERER, $referer);
        }
        if ($ua) {
            curl_setopt($ch, CURLOPT_USERAGENT, $ua);
        } else {
            curl_setopt($ch, CURLOPT_USERAGENT, $this->ua);
        }
        if ($nobaody) {
            curl_setopt($ch, CURLOPT_NOBODY, 1);

        }
        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
        curl_setopt($ch, CURLOPT_ENCODING, "gzip");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $ret = curl_exec($ch);
        curl_close($ch);
        return $ret;
    }

    private function get_curl_split($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        $httpheader[] = "Accept: */*";
        $httpheader[] = "Accept-Encoding: gzip,deflate,sdch";
        $httpheader[] = "Accept-Language: zh-CN,zh;q=0.8";
        $httpheader[] = "Connection: keep-alive";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
        curl_setopt($ch, CURLOPT_HEADER, TRUE);
        curl_setopt($ch, CURLOPT_USERAGENT, $this->ua);
        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
        curl_setopt($ch, CURLOPT_ENCODING, "gzip");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $ret = curl_exec($ch);
        $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
        $header = substr($ret, 0, $headerSize);
        $body = substr($ret, $headerSize);
        $ret = array();
        $ret['header'] = $header;
        $ret['body'] = $body;
        curl_close($ch);
        return $ret;
    }

    private function get_curl_proxy($url, $post = 0, $referer = 0, $cookie = 0, $header = 0, $ua = 0, $nobaody = 0)
    {
        $data = array('url' => $url, 'post' => $post, 'referer' => $referer, 'cookie' => $cookie, 'header' => $header, 'ua' => $ua, 'nobaody' => $nobaody);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch, CURLOPT_URL, $this->loginapi);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $ret = curl_exec($ch);
        curl_close($ch);
        return $ret;
    }
	
	protected
    function _initialize()
    {
        parent::_initialize();
        $this->checkLogin();
		
    }
	
	private
    function checkLogin()
    {
        $check_Login = Users::checkLogin();
        if ($check_Login != null) {
            $this->assign('alert', $check_Login['msg']);
            $this->assign('url', $check_Login['url']);
            exit($this->fetch('pc/common/msg'));
        } else {
            $this->userInfo = Users::getLoginUser();
            $this->assign('userInfo', $this->userInfo);

        }
    }
}